/*
 * uart_slave_reg.h
 *
 *  Created on: Jun 2, 2025
 *      Author: lsy18
 */

#ifndef COMMUNICATE_UART_SLAVE_REG_UART_SLAVE_REG_H_
#define COMMUNICATE_UART_SLAVE_REG_UART_SLAVE_REG_H_

#include <stdint.h>

typedef enum
{
	MODE_REG = 0x00,
	TIME_INT_REG = 0x01,
	REGISTER_STAR_REG = 0x02,
	REGISTER_NUM_REG = 0x03,
	PWM_LEFT_L_REG = 0x04,
	PWM_LEFT_H_REG = 0x05,
	PWM_RIGHT_L_REG = 0x06,
	PWM_RIGHT_H_REG = 0x07,
	ROLL_L__REG = 0x08,
	ROLL_H_REG = 0x09,
	PITCH_L_REG = 0x0A,
	PITCH_H_REG = 0x0B,
	YAW_L_REG = 0x0C,
	YAW_H_REG = 0x0D,
}REG_adress;

typedef enum
{
	answer_mode = 0x00,
	time_mode = 0x01,
}Work_MODE;

extern uint8_t reg_array[256];

void uart_slave_reg_init();

void uart_slave_reg_write(uint8_t *data , REG_adress adress , uint8_t reg_num);
void uart_slave_reg_read(uint8_t *data , REG_adress adress , uint8_t reg_num);

#endif /* COMMUNICATE_UART_SLAVE_REG_UART_SLAVE_REG_H_ */
